<template>
	<view class="padb30">
		<cu-custom bgColor="bg-gradual-blue" isBack>
			<block slot="content">我的消息</block>
			<block slot="backText">返回</block>
		</cu-custom>
		<!-- <view class="flrc bg-white ripple" @tap="$win.navto"
		data-url="/pages/stream/createOrder/createOrder">
			<view class="wh30-30 flcc">
				<text class="fa fa-file-text fa-4x"></text>
			</view>
			<view class="flex1">
				<view class="fs14">创建新订单</view>
				<view>创建、审核、排产、交付</view>
			</view>
			<view class="fa fa-angle-right pad3"></view>
		</view> -->
		<view class="mart3">
			<view class="list-style-1">消息列表</view>
		</view>
		<view>
			<view class="bcf round5 shadow1 marlr3 mart3" v-for="(item,index) in list" :key="index">
				<view class="lh2 pad2 flrc">
					<view class="flex1 ofe">{{item.title}}</view>
					<view v-if="$com.isbool(item.isToAll)" class="fs8 cu-btn line-gray sm">全员通知</view>
					<view v-if="!$com.isbool(item.isToAll)" class="fs8 cu-btn line-orange sm">定向推送</view>
				</view>
				<view class="bdtso pad3 bc13 ">
					{{item.content}}
				</view>
				<view class="tar pad2 fs8">
					{{$com.str2time(item.createAt)}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import api from '../../../static/js/api.js'
	import com from '../../../static/js/com.js'
	import win from '../../../static/js/win.js'
	import list from '../../../static/js/list.js'
	export default {

		data() {
			return {
				list: []
			}
		},
		methods: {
		},
		created() {

		},
		onShow() {
			
			let _this = this
			list.setUrl('/api/my/messages')
			list.setData({})
			list.setCbFunc((res) => {
				uni.stopPullDownRefresh();
				console.log(res)
				this.list = res
			})
			list.reload()
			
		},
		onReachBottom() {
			list.getList()
		},
		onPullDownRefresh() {
			list.reload()
		}
	}
</script>

<style>

</style>
